package com.cj.mobile.iabp.mvp.model.entity;

import java.util.List;

/**
 * @ProjectName: AptitudeAndroid
 * @Package: com.cj.mobile.iabp.mvp.model.entity
 * @ClassName: ChatMessage
 * @Description: 聊天消息
 * @Author: WLY
 * @CreateDate: 2022/10/19 18:24
 */
public class ChatMessage {
    public ChatMessage() {
    }

    /**
     * 发送图片消息
     */
    public ChatMessage(String contentId, String contentType, String userType, String avatar, String createTime, String chatContent, String picPath, int state) {
        this.contentId = contentId;
        this.contentType = contentType;
        this.userType = userType;
        if (userType.equalsIgnoreCase("1")) {
            // 我发的
            pictureFile = avatar;
        } else {
            // 我收到的
            pictureFile = avatar;
        }
        this.createTime = createTime;
        this.content = chatContent;
        this.picPath = picPath;
        this.state = state;
    }

    /**
     * 发送文字消息
     */
    public ChatMessage(String contentId, String contentType, String userType, String avatar, String createTime, String content, int state) {
        this.contentId = contentId;
        this.contentType = contentType;
        this.userType = userType;
        if (userType.equalsIgnoreCase("1")) {
            // 我发的
            pictureFile = avatar;
        } else {
            // 我收到的
            pictureFile = avatar;
        }
        this.createTime = createTime;
        this.content = content;
        this.state = state;
    }

    /**
     * 发送语音消息
     */
    public ChatMessage(String contentId, String contentType, String userType, String avatar, String createTime, String duration, String chatContent, String voicePath, int state) {
        this.contentId = contentId;
        this.contentType = contentType;
        this.userType = userType;
        if (userType.equalsIgnoreCase("1")) {
            // 我发的
            pictureFile = avatar;
        } else {
            // 我收到的
            pictureFile = avatar;
        }
        this.createTime = createTime;
        this.duration = duration;
        this.content = chatContent;
        this.voicePath = voicePath;
        this.state = state;
    }

    /**
     * 发送订单消息
     */
    public ChatMessage(String contentId, String contentType, String userType, String avatar, String createTime, String chatContent, ChatOrderInfo orderModel, int state) {
        this.contentId = contentId;
        this.contentType = contentType;
        this.userType = userType;
        if (userType.equalsIgnoreCase("1")) {
            // 我发的
            pictureFile = avatar;
        } else {
            // 我收到的
            pictureFile = avatar;
        }
        this.createTime = createTime;
        this.content = chatContent;
        this.orderModel = orderModel;
        this.state = state;
    }

    // ID
    private String id = "";
    // 发送消息方
    private String fromUserId;
    // 接受消息方
    private String userId;
    // 用户名
    private String userName;
    // 传输类型1. 文字内容，2.图片，3.语音，4.订单
    private String contentType;
    // 语音长度，秒
    private String duration;
    // 聊天内容（对应类型存储，2和3存储路径，4存储订单号）
    private String content;
    // 消息内容id
    private String contentId;
    // 文件名
    private String fileName;
    // 图片原图
    private String filePath;
    // 是否已读
    private boolean isRead;
    // 是否播放
    private boolean isPlay;
    // 创建时间
    private String createTime;
    // 创建用户
    private String createUser;
    // 修改时间
    private String updateTime;
    // 修改用户
    private String updateUser;
    // 备注
    private String remark;
    // 如果是订单类型，则返回订单详情
    private ChatOrderInfo orderModel = new ChatOrderInfo();
    // 会话id
    private String sessionId;
    // 头像图片
    private String pictureFile;
    // 用户类型1.回收商发送，2.门店发送，3客服发送
    private String userType;
    // 聊天室中“人”
    private List<ChatUserMode> chatSessionUserModelList;
    // 推荐最新订单
    private ChatOrderInfo orderInfo;

    // 收到的消息
    private ChatMessage chatMessageModel;

    // 本地语音
    private String voicePath;
    // 本地图片
    private String picPath;
    // 0成功，1发送中，2失败
    private int state = 0;

    public ChatMessage getChatMessageModel() {
        return chatMessageModel;
    }

    public void setChatMessageModel(ChatMessage chatMessageModel) {
        this.chatMessageModel = chatMessageModel;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getFromUserId() {
        return fromUserId;
    }

    public void setFromUserId(String fromUserId) {
        this.fromUserId = fromUserId;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getContentType() {
        return contentType;
    }

    public void setContentType(String contentType) {
        this.contentType = contentType;
    }

    public String getDuration() {
        return duration;
    }

    public void setDuration(String duration) {
        this.duration = duration;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getContentId() {
        return contentId;
    }

    public void setContentId(String contentId) {
        this.contentId = contentId;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public String getFilePath() {
        return filePath;
    }

    public void setFilePath(String filePath) {
        this.filePath = filePath;
    }

    public boolean isRead() {
        return isRead;
    }

    public void setRead(boolean read) {
        isRead = read;
    }

    public boolean isPlay() {
        return isPlay;
    }

    public void setPlay(boolean play) {
        isPlay = play;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getCreateUser() {
        return createUser;
    }

    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public String getUpdateUser() {
        return updateUser;
    }

    public void setUpdateUser(String updateUser) {
        this.updateUser = updateUser;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public ChatOrderInfo getOrderModel() {
        return orderModel;
    }

    public void setOrderModel(ChatOrderInfo orderModel) {
        this.orderModel = orderModel;
    }

    public String getSessionId() {
        return sessionId;
    }

    public void setSessionId(String sessionId) {
        this.sessionId = sessionId;
    }

    public String getPictureFile() {
        return pictureFile;
    }

    public void setPictureFile(String pictureFile) {
        this.pictureFile = pictureFile;
    }

    public String getUserType() {
        return userType;
    }

    public void setUserType(String userType) {
        this.userType = userType;
    }

    public List<ChatUserMode> getChatSessionUserModelList() {
        return chatSessionUserModelList;
    }

    public void setChatSessionUserModelList(List<ChatUserMode> chatSessionUserModelList) {
        this.chatSessionUserModelList = chatSessionUserModelList;
    }

    public ChatOrderInfo getOrderInfo() {
        return orderInfo;
    }

    public void setOrderInfo(ChatOrderInfo orderInfo) {
        this.orderInfo = orderInfo;
    }

    public String getVoicePath() {
        return voicePath;
    }

    public void setVoicePath(String voicePath) {
        this.voicePath = voicePath;
    }

    public String getPicPath() {
        return picPath;
    }

    public void setPicPath(String picPath) {
        this.picPath = picPath;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }
}
